package com.xxl.job.kettle.core.service;

import com.xxl.job.kettle.core.entity.DiCategory;
import com.xxl.job.kettle.core.entity.KRepository;
import com.xxl.job.kettle.core.entity.TreeDTO;
import com.xxl.job.kettle.result.Result;

import java.util.List;
import java.util.Map;

/**
 * 实现功能：
 *
 * @author 作者[zk]
 * @version 1.0.00  2022-11-29 10:06
 */
public interface DiCategoryService extends BaseService<DiCategory> {

    /**
     * 根据资源库id获取分类树
     * @param repId
     * @return
     * @throws Exception
     */
    List<TreeDTO<String>> findDiCategoryByRep(String repId) throws Exception;

    /**
     * 通过id删除资源库目录
     * @param dirId
     * @param repId
     * @return
     * @throws Exception
     */
    Result<Object> delete(String dirId, String repId) throws Exception;

    /**
     * 添加目录
     * @param param
     * @return
     * @throws Exception
     */
    Result add(Map<String, String> param) throws Exception;

    /**
     * 修改目录
     * @param param
     * @throws Exception
     */
    void update(Map<String, String> param) throws Exception;

    /**
     * 获取资源库信息
     * @param id
     * @return
     */
    KRepository findRepositoryById(String id);
}
